package com.example.demo.singoton;

/**
 * @Description
 * @Author youxin
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/12/22
 */
public class SingletonTest2 {
    public static void main(String[] args) {

    }
}

class Singleton2{
    private Singleton2(){}
    private static  Singleton2 singleton2;
    public static synchronized Singleton2 getSingleton2(){
        singleton2=new Singleton2();
        return singleton2;
    }
}
